package com.gzk.hrm.feign;


import com.gzk.hrm.util.AjaxResult;
import com.gzk.hrm.doc.CourseDoc;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class CourseElasticSearchFeignFallbackFactory implements FallbackFactory<CourseElasticSearchFeign> {
    @Override
    public CourseElasticSearchFeign create(Throwable throwable) {
        return new CourseElasticSearchFeign() {
            @Override
            public AjaxResult saveCourse(CourseDoc doc) {
                throwable.printStackTrace();
                return new AjaxResult().setSuccess(false).setMessage("全文搜索中心调用失败！！");
            }

            @Override
            public AjaxResult deleteCourse(Long id) {
                throwable.printStackTrace();
                return new AjaxResult().setSuccess(false).setMessage("全文搜索中心调用失败！！");
            }
        };
    }
}
